<?php
$html = str_replace('<!--{titulo}-->', htmlentities($photography->titulo), $html);
$html = str_replace('<!--{descripcion}-->', nl2br(htmlentities($photography->descripcion)), $html);

//galerias
$images = '';
$i=0;
foreach ($photography->galleries() as $gallery) {
    $images .= $imagesTpl;
    $images = str_replace('<!--{uri}-->', $gallery->uri, $images);
    $images = str_replace('<!--{portada}-->', $gallery->portada->src, $images);
    $images = str_replace('<!--{titulo}-->', htmlentities($gallery->titulo), $images);
    if ($i && $i%3 == 0) {
        $images = str_replace('<!--{offset}-->', ' large-offset-3', $images);
    } else {
        $images = str_replace('<!--{offset}-->', '', $images);
    }
    $i++;
}
$html = str_replace('<!--{galleries}-->', $images, $html);

$html = str_replace('<!--{url}-->', URL, $html);
$html = str_replace('<!--{photographyUri}-->', $photography->uri, $html);


$html = preg_replace('/<!-+\{*[A-Za-z0-9]*\}*-+>/', '', $html);
?>
